function iv = gen_iv_monte_carlo(min_profit, max_profit, profit_cutoff_min, profit_cutoff_max)

if ~isequal(profit_cutoff_min, profit_cutoff_max); error('the following code assumes that profit_cutoff_min = profit_cutoff_max'); end;
profit_cutoff = profit_cutoff_min;
iv = [];
for k1 = 1 : length(profit_cutoff)-1
    for k2 = k1+1 : length(profit_cutoff)   
        iv = [iv ...
            ((profit_cutoff(k1)<=min_profit) & (max_profit<=profit_cutoff(k2)))];
    end
end
for k = 1 : length(profit_cutoff)
    iv = [iv, min_profit>=profit_cutoff(k), max_profit<=profit_cutoff(k)];
end
